From 32ab1faf4b009835cd215077c02ea2959a9c341a Mon Sep 17 00:00:00 2001 From: parkrrrr Date: Fri, 25 Mar 2005 16:57:22 +0000 Subject: [PATCH] Added code to write out the .bmp files embedded in .an1 files. --- gpsbabel/intdoc/SA2003_an1_dump.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gpsbabel/intdoc/SA2003_an1_dump.pl b/gpsbabel/intdoc/SA2003_an1_dump.pl index acf497da1..b38cc9e2c 100644 --- a/gpsbabel/intdoc/SA2003_an1_dump.pl +++ b/gpsbabel/intdoc/SA2003_an1_dump.pl @@ -82,6 +82,17 @@ while ( $bitmapcount ) { $size, $xppm, $yppm, $colused, $colimprt ) = shiftunpack( 'lllssllllll'); # palette $palettesize = $bitoffset - $bmisize - 14; # 14 bytes in BMFH, including the 'BM' + open BMP, ">bitmap$filecount.bmp"; + binmode BMP; + print BMP 'BM'; + $head = pack('lssl', ($fhsize, $res_0_1, $res_0_2, $bitoffset)); + print BMP $head; + $head = pack('lllssllllll', ($bmisize, $width, $height, $planes, $bpp, + $compression, $size, $xppm, $yppm, $colused, $colimprt)); + print BMP $head; + print BMP substr($file, 0, $palettesize+$size); + close BMP; + $filecount++; skip_bytes( $palettesize ); # image skip_bytes( $size ); -- 2.30.2